<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <title>递归函数 - 计算阶乘</title>
</head>
<body>

<script>
    function jc(n) {
        if (n == 1){
            return 1;
        }else{
            return n * jc(n-1);
        }
    }
    console.log(jc(5));

</script>

</body>
</html>